<div id="sidebar">

	<ul>

		<li class="section_header"><? if(pageid == "trashheap") { echo "TrashHeap"; } else { echo ucwords(pageid); } ?></li>

<?
	if(pageid == "base") {
		if(function_exists(trash_count)/* && (trash_count() > 0)*/) {
			echo "<li><a href=\"trashheap.php\" title=\"View the TrashHeap\">TrashHeap (" . trash_count() . ")</a></li>";
		}
	}

		if(pageid == "blog") {
?>
		<li<? if(!$_GET) { echo " class=\"current\""; }?>><a href="blog.php">View Current Posts</a></li>

		<li<? if($_GET['action'] == "new") { echo " class=\"current\""; }?>><a href="blog.php?action=new">Write New Post</a></li>

		<li<? if($_GET['action'] == "view_drafts") { echo " class=\"current\""; }?>><a href="blog.php?action=view_drafts">Work on Drafts (<? echo drafts_count("blog,aside"); ?>)</a></li>
<?
		}
	
	if(pageid == "pages") {
?>
	<li<? if(!$_GET) { echo " class=\"current\""; }?>><a href="pages.php" title="View All Pages">View All Pages</a></li>

	<li<? if($_GET['action'] == "new") { echo " class=\"current\""; }?>><a href="pages.php?action=new">Write New Page</a></li>
	
	<li<? if($_GET['action'] == "view_drafts") { echo " class=\"current\""; }?>><a href="pages.php?action=view_drafts">Work on Drafts (<? echo drafts_count("page"); ?>)</a></li>
<?
	}
	
	if(pageid == "trashheap") {
?>
	<li class="current"><a href="trashheap.php" title="View the TrashHeap">View the TrashHeap</a></li>
<?
	}
?>
		<br class="clear" />

	</ul>
	
</div>